package com.designmodel.atcion.memento;

/**
 * ��������Բ��ͣ�http://blog.csdn.net/zhangerqing email:xtfggef@gmail.com
 * ΢����http://weibo.com/xtfggef
 *
 * @author egg
 */
public class Test {

    public static void main(String[] args) {

        Original origi = new Original("egg");

        Storage storage = new Storage(origi.createMemento());

        System.out.println("Original value is: " + origi.getValue());
        origi.setValue("niu");
        System.out.println("New value is: " + origi.getValue());

        origi.restoreMemento(storage.getMemento());
        System.out.println("Original value is: " + origi.getValue());
    }
}
